package com.example.review.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.review.dao.EmpDao;
import com.example.review.entity.Emp;
import com.example.review.service.EmpService;
import com.example.review.vo.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
//extends ServiceImpl<TUserMapper, TUser> implements ITUserService
@Service
public class EmpServiceImpl extends ServiceImpl<EmpDao,Emp> implements EmpService {

    @Resource
    private EmpDao empDao;

    @Override
    public Result<IPage<Emp>> listByPage(Integer currentPage, Integer pageSize) {
        Page<Emp> page = new Page<>(currentPage,pageSize);
        //有where条件就创建queryWrapper对象
        IPage<Emp> empIPage = empDao.queryTest(page, null);
        return new Result<>(200,"操作成功",empIPage);
    }
}
